# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models
from ueditor.models import UEditorField

# Create your models here.


class Advertisement(models.Model):

    POSITION_CHOICES = (
        (0, '幻灯片广告'),
    )

    name = models.CharField(max_length=50, verbose_name='名称')
    position = models.PositiveSmallIntegerField(
        default=0, choices=POSITION_CHOICES, verbose_name='广告位置')
    image = models.ImageField(verbose_name='广告图片')
    desc = UEditorField(verbose_name='广告描述', blank=True, toolbars="mini")
    enable = models.BooleanField(default=True, verbose_name='是否启用')
    create = models.DateTimeField(
        auto_now_add=True, verbose_name='创建时间')
    modify = models.DateTimeField(
        auto_now=True, verbose_name='修改时间')

    class Meta:
        db_table = 'advertisement'
        verbose_name = '广告'
        verbose_name_plural = '广告'
